package com.qf.quduba.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * 作者：${尹俊}
 * 时间：2020/7/1715:08
 */
@WebFilter({"/*"})
public class EncodingFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        servletRequest.setCharacterEncoding("utf-8");
        servletResponse.setContentType("application/json;charset=UTF-8");
        filterChain.doFilter(servletRequest,servletResponse);
    }
}
